<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         const acquisitionColumnsNameMap = [
              ['sample.title', 'Sample Name'],
              ['sample.ohInternationalSampleNumber', 'ISN'],
        [/^[\w]+\.ohInternationalVesselNumber$/, 'IVN'],
                  [/^[\w]+\.ohBarcode$/, 'Barcode'],
  ['sample.substance.ohChemicalSampleNumber', 'CSN'],
  ['sample.experiment.title', 'Experiment Name'],
];
        const path ='sample.experiment.titl5e';
        const getHardcodeColumnName = (path) => {
          return acquisitionColumnsNameMap.find((item) => {
            if (typeof(item[0]) === 'string') {
              return path === item[0];
            }
             return (item[0]).test(path);
           })?.[1];
         };
      console.log(   getHardcodeColumnName(path));
    </script>
</body>
</html>